<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:p='http://primefaces.org/ui'
      xmlns:h='http://java.sun.com/jsf/html'
      xmlns:f='http://java.sun.com/jsf/core'
      xmlns:cc='http://java.sun.com/jsf/composite'>

<cc:interface>

<cc:attribute name='id'/>

<cc:attribute name='bean'/>

<cc:attribute name='ls'/>

<cc:attribute name='c' default='#{x.material.id}'/>

<cc:attribute name='d' method-signature='void listener()'/>

<cc:attribute name='u' default='@(.#{cc.attrs.bean.name})'/>

<cc:attribute name='edit' default='true'/>

<cc:attribute name='image' default='true'/>

</cc:interface>


<cc:implementation>

<h:panelGroup id='table'>

<p:dataTable value='#{cc.attrs.ls}' var='x' paginator='true' paginatorPosition='bottom' rows='15' resizableColumns='true' rendered='#{not empty cc.attrs.ls}'

             paginatorAlwaysVisible='false' emptyMessage='' selectionMode='single' rowKey='#{cc.attrs.c}' filteredValue='#{cc.attrs.bean.lsFiltered}' style='width:100%'>

<p:ajax event='rowSelect' listener='#{cc.attrs.bean.detailEdit}' update='#{cc.attrs.u}' disabled='#{!cc.attrs.edit}'/>

<p:column style='width:40px' rendered='#{cc.attrs.edit}'>

<f:facet name='header'><p:commandButton icon='ui-icon-trash' style='border: none; background: transparent'/></f:facet>

<p:commandLink actionListener='#{cc.attrs.bean.detailDelete(x)}' title='Eliminar' update='#{cc.attrs.u}' process=":#{p:component('table')}">

<p:graphicImage alt='Sin Icono' value='http://#{facesContext.externalContext.requestServerName}/savanti/material/#{cc.attrs.c}.png' width='42' height='42'/>

</p:commandLink>

</p:column>


<p:column style='width:40px' rendered='#{!cc.attrs.edit and cc.attrs.image}'>

<f:facet name='header'><p:commandButton icon='ui-icon-trash' style='border: none; background: transparent'/></f:facet>

<p:graphicImage alt='Sin Icono' value='http://#{facesContext.externalContext.requestServerName}/savanti/material/#{cc.attrs.c}.png' width='42' height='42'/>

</p:column>

<cc:insertChildren/>

</p:dataTable>

</h:panelGroup>

</cc:implementation>

</html>